from selenium.webdriver.common.by import By
from common.base import Base



# 小型手机页面的定位
class Browser2Page(Base):
    def good1(self):
        # 第一件商品
        goods = self.find_elements((By.LINK_TEXT, "立即购买"))
        goods[0].click()
    def good2(self):
        # 第二件商品
        goods = self.find_elements((By.LINK_TEXT, "立即购买"))
        goods[1].click()
    def good3(self):
        # 第三件商品
        goods = self.find_elements((By.LINK_TEXT, "立即购买"))
        goods[2].click()
    def good1name(self):
        # 返回text
        return self.get_text((By.XPATH,"//div[@class='goods-title']/a[@title='诺基亚N85']"))
    def good2name(self):
        return self.get_text((By.XPATH,"//div[@class='goods-title']/a[@title='诺基亚E66']"))
    def good3name(self):
        return self.get_text((By.XPATH,"//div[@class='goods-title']/a[@title='飞利浦9@9v']"))







